package com.cqjtu.store.common;


import lombok.Data;

//结果返回类
@Data
public class Result {
    private static final  String SUSSESS_CODE="200";
    private static final  String ERROR_CODE="-1";


    private String code;
    private Object data;
    private String msg;

    public static Result succuss(){
        Result result = new Result();
        result.setCode(SUSSESS_CODE);
        return result;
    }
    public static Result succuss(Object data){
        Result result = new Result();
        result.setCode(SUSSESS_CODE);
        result.setData(data);
        return result;
    }
    public static Result error(String msg){
        Result result = new Result();
        result.setCode(ERROR_CODE);
        result.setMsg(msg);
        return result;
    }

    public static Result error(String code, String message) {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(message);
        return result;
    }
}
